package com.javatest.springbootcxf.config;

import com.javatest.springbootcxf.service.HelloServiceImpl;
import javax.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/21 23:12
 */
@Configuration
public class WebServiceConfig {
    @Autowired
    private Bus bus;

    @Autowired
    public HelloServiceImpl helloService;

    @Bean
    public Endpoint endpoint(HelloServiceImpl service) {
        EndpointImpl endpoint = new EndpointImpl(bus, service);
        endpoint.publish("/Hello");
        return endpoint;
    }
}
